<?php
/**
 * Абстрактный контроллер модуля.
 *
 * @property Zend_Controller_Request_Http $_request
 */
abstract class Users_Model_Abstract_AdminController extends Workset_Controller_Action_Admin {
	/**
	 * Перенаправление пользователя по обратному УРЛ.
     *
     * @return void
	 */
	protected function _redirectToBackUrl() {
		if ($this->_request->getParam('backurl')) {
            /** @noinspection PhpUndefinedMethodInspection */
            $sBackUrl = $this->_helper->httpUri($this->_request->getParam('backurl'));
		}
		else {
			$sBackUrl = strpos($_SERVER['HTTP_REFERER'],parse_url('http://'.$this->_request->getHttpHost().$_SERVER['REQUEST_URI'],PHP_URL_PATH)) >= 0
				? 'http://'.$this->_request->getHttpHost().'/'
				: $_SERVER['HTTP_REFERER'];
		}

		$this->_response->setRedirect($sBackUrl,302);
	}
}
?>